package top.zosoft.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author neal
 * @date 2023/12/26  14:20
 */
@AllArgsConstructor
@Getter
public enum ServerType {
    MQTT(1, "MQTT","MQTT-BROKER"),
    COAP(2, "COAP","COAP-SERVER"),
    TCP(3, "TCP","TCP-SERVER"),
    UDP(4, "UDP","UDP-SERVER"),
    WEBSOCKET(5,"WEBSOCKET","WEBSOCKET-SERVER"),
    GB28181(6,"GB28181","SIP-SERVER"),
    LWM2M(7,"LWM2M","LWM2M-SERVER"),
    OTHER(999,"WEBSOCKET","MQTT-BROKER");


    private int type;
    private String name;
    private String des;

    public static ServerType explain(String name){
        for(ServerType serverType:ServerType.values()){
            if(serverType.name.equals(name)){
                return serverType;
            }
        }
        return MQTT;
    }
}
